package com.gaojiawei.multiThread08_Synchronized;

import org.junit.Test;
import org.openjdk.jol.info.ClassLayout;
import sun.awt.windows.ThemeReader;

public class L03_AnonymousBiasStatus {

    @Test
    public void testAnonymousBiasStatus() throws InterruptedException {

        Object o = new Object();
        System.out.println(ClassLayout.parseInstance(o).toPrintable());

        Thread.sleep(6000);
        Object o1 = new Object();
        //now is Anonymous bias
        System.out.println(ClassLayout.parseInstance(o1).toPrintable());


        //now is bias
        synchronized (o1){
            System.out.println(ClassLayout.parseInstance(o).toPrintable());

        }
    }
}
